<!--
	作者：956911785@qq.com
	时间：2018-10-18
	描述：账号-添加
-->

<template>
	<Tcontent ref="Tcontent" :teas="params" :title="title" @addsave="addsave"></Tcontent>
</template>

<script>
	import Tcontent from "./Tcontent";
	export default {
		name:"addCampus",
		props: {
    		
    	},
		data() {
			return {
				params:{
					usid:'', 
					usname:'', 
					csid:'',
				},
				title:'添加账号'
			}
		},
		components: {
			Tcontent
		},
		methods: {
			addsave:function(datas){
				const da={...datas};
				var pcaid=this.user.PCAID;
				var pcalv="3";
				
				const params={
					pcaid:pcaid, 
					pcalv:pcalv,
					usname:da.usname, 
					csid:da.csid,
				};
	
                this.$http.post("/host/bmxt/campus/InsertUsers.html",params)
				.then(result => {
					if(result){
						this.$Modal.success({
                            title: "提示",
                            content: "添加成功！"
                       });
                       this.$emit("reload");
                       this.$refs.Tcontent.closeModal();
					}else{
						this.$Modal.error({
                            title: "提示",
                            content: "添加失败，请联系管理员！"
                       });	
					}
				});
	        },
			openmodal(){
				this.$refs.Tcontent.modal0 = true;
			}
		},
		mounted() {

		},
		watch:{
			
		},
		computed: {
			user: function() {
				return this.$store.state.app.user;
			}
		}
		
	}
</script>

<style scoped="scoped">
	
</style>



